package com.yanqu.road.server.cmd.activity.langyabang.fromCross;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.LangYaBangProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.activity.langyabang.LangYaBangMgr;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_LANG_YA_BANG_CROSS_SYNC_CONDITION_TO_GAME,desc = "跨服来更新本服的排行榜数据")
public class LangYaUpdateConditionFromCrossCmd extends AbstractCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        LangYaBangProto.LangYaBangUpdateConditionReqMsg langYaBangUpdateConditionReqMsg = LangYaBangProto.LangYaBangUpdateConditionReqMsg.parseFrom(packet.getBytes());
        int activityId = langYaBangUpdateConditionReqMsg.getActivityId();
        long userId = langYaBangUpdateConditionReqMsg.getUserId();
        long score = langYaBangUpdateConditionReqMsg.getScore();
        LangYaBangMgr.changeUserLangYaBangUnionScore(activityId,userId,score);


    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
